<?php

namespace App\Clients\MeiTuan;

use Exception;
use GuzzleHttp\Exception\GuzzleException;

class ReportsBusinessIncome extends MeiTuanClient
{

    /**
     * 初步处理数据
     * @return void
     */
    public function handleData(): void
    {
        try{
            $this->contents = json_decode($this->contents["data"],true);
        }catch(Exception $e){
            var_dump($this->contents);
            throw $e;
        }
    }

    /**
     * @throws GuzzleException
     */
    public function execute($queryData): ReportsBusinessIncome
    {
        return $this->post("https://pos.meituan.com/web/api/v2/reports/business-income?yodaReady=h5&csecplatform=4&csecversion=3.2.0",$queryData);
    }
}
